package communication.common.business.user;

import communication.common.business.base.FcrSocketAddress;
import communication.common.business.user.request.LoginRequest;
import communication.common.business.user.request.RegistryRequest;
import communication.common.business.user.response.UserLoggedInfo;


/**
 * @author mac
 */
public interface UserService {

    /**
     * 注册新用户
     * @param request 注册信息
     * @return Long 注册成功后返回userId
     * @exception Exception 注册手机号重复、账户名重复都会抛出异常
     */
    Long registry(RegistryRequest request) throws Exception;

    /**
     * 用户登录
     * @param loginRequest 登录请求
     * @param remoteSocketAddress
     * @return    UserLoggedInfo
     */
    UserLoggedInfo loginByAccountName(LoginRequest loginRequest, FcrSocketAddress remoteSocketAddress) throws Exception;
}
